#!/bin/bash

# 确保脚本在发生错误时退出
# set -e

sudo apt install -y qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
docker buildx inspect --bootstrap


# 构建镜像
docker buildx build \
    --platform linux/arm64 \
    -f ./kylin_v10_arm64/DockerFile \
    --load \
    -t ubuntu_arm64_kylinv10:v1.0.0 kylin_v10_arm64

# echo "ARM64 镜像构建完成"

# 构建镜像并加载到本地 Docker 镜像库，指定 Dockerfile 路径
# docker buildx build --platform linux/arm64 -t my-arm64-ubuntu -f kylin_v10_arm64/Dockerfile ./kylin_v10_arm64 --load